<!--
 * @Author: Zhouxin 2201_75539691@noreply.gitcode.com
 * @Date: 2024-11-18 19:56:54
 * @LastEditors: Zhouxin 2201_75539691@noreply.gitcode.com
 * @LastEditTime: 2024-11-18 20:15:28
 * @FilePath: \2024.11.15-day05-隐式转换 控制流程c:\Users\zhou'xin\Desktop\Gitee仓库\qd-project-shizhibo\第二阶段：JavaScript\2024.11.18-day07-数组\demo1.html
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<!-- 一、看数组 观察变化找规律
初始 ['a','b','c','d','e'] 
第一次 ['d','e','a','b','c']
第二次 ['b','c','d','e','a']
第三次 ['e','a','b','c','d']
...
请问第五次 第十五次数组是如何? -->

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var arr = ['a','b','c','d','e'];
        for(var j = 0; j < 15; j++){
            var output = [];
            for(var i = 0; i<arr.length; i++){
                output.push(arr[(i+2*j)%arr.length]);
            }
            console.log(output.join(' '));
            console.log("------------");
        }

    </script>
</body>
</html>